package com.bjtu.restaurantreviews.dao;

import com.bjtu.restaurantreviews.domain.Review;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @Author: Chen
 * @Description:
 * @Date: Created in 16:24 2018/5/17
 */
public interface ReviewRepository extends JpaRepository<Review,Long> {
    //根据餐馆id查询
    Page<Review> findByRevrid(int rid,Pageable pageable);

    //根据用户id查询
    Page<Review> findByRevuid(Integer revuid,Pageable pageable);

    List<Review> findAll();
    //根据餐馆id查询按时间排序
    Page<Review> findByRevridOrderByRevtimeDesc(int rid,Pageable pageable);
}
